package com.kaishengit.util;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

public class StringUtil {
	public static boolean isEmpty(String str){
		if("".equals(str) || str==null){
			return true;
		}else{
			return false;
		}
	}
	public static boolean isNotEmpty(String str){
		return !isEmpty(str);
	}
	
	public static String ISOtoUTF(String str){
		try{
			if(isNotEmpty(str)){
				return new String(str.getBytes("ISO8859-1"),"UTF-8");
			}
			return "";
		}catch(UnsupportedEncodingException e){
			e.printStackTrace();
			return "";
		}
	}
	
	public static List<String> strToList(String str){
		String[] strArray = str.split(",");
		List<String> list = new ArrayList<String>();
		for(String temp : strArray){
			list.add(temp.trim());
		}
		return list;
	}
}
